package com.armani.mapper;

import com.armani.entity.Great;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName GreatMapper
 * @Description TODO
 * @Author Xinyibuzai
 * @Date 2021/11/28 17:13
 * @Version 1.0
 **/
public interface GreatMapper {
    /**
     * @MethodName listSearch
     * @Description TODO 
     * @Param startRow
     * @Param limit
     * @Param name
     * @Param spuId 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/28 
     **/
    List<Great> listSearch(@Param(value = "startRow") Integer startRow,
                           @Param(value = "limit") Integer limit,
                           @Param(value = "name") String name);
    /**
     * @MethodName getCount
     * @Description TODO 
     * @Param name
     * @Param spuId 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/28 
     **/
    Integer getCount(@Param(value = "name") String name);
    /**
     * @MethodName update
     * @Description TODO 
     * @Param name
     * @Param image
     * @Param url
     * @Param spuId
     * @Param state
     * @Param sort
     * @Param id 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/28 
     **/
    void update(@Param(value = "name") String name,
                @Param(value = "image") String image,
                @Param(value = "url") String url,
                @Param(value = "spuId") Integer spuId,
                @Param(value = "state") Integer state,
                @Param(value = "sort") Integer sort,
                @Param(value = "id") Integer id);
    /**
     * @MethodName insert
     * @Description TODO 
     * @Param name
     * @Param image
     * @Param url
     * @Param spuId
     * @Param state
     * @Param sort 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/28 
     **/
    void insert(@Param(value = "name") String name,
                @Param(value = "image") String image,
                @Param(value = "url") String url,
                @Param(value = "spuId") Integer spuId,
                @Param(value = "state") Integer state,
                @Param(value = "sort") Integer sort);
    /**
     * @MethodName delete
     * @Description TODO 
     * @Param id 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/28 
     **/
    void delete(@Param(value = "id") Integer id);
    /**
     * @MethodName state
     * @Description 上架/下架
     * @Param id
     * @Param state
     * @Return
     * @Author Xinyibuzai
     * @Date 2021/12/3
     **/
    Integer state(@Param(value = "id") Integer id,
                  @Param(value = "state")Integer state);

    List<Great> pageSearch(@Param(value = "name") String name);
}
